package com.usian.ai.controller;

import com.usian.ai.common.Result;
import com.usian.ai.pojo.Job;
import com.usian.ai.pojo.vo.JobReqVo;
import com.usian.ai.pojo.vo.PageVo;
import com.usian.ai.service.FileOssService;
import com.usian.ai.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 12 06 11 39
 **/

@RestController
@RequestMapping("/job")
@CrossOrigin
public class JobController {

    final
    JobService jobService;

    public JobController(JobService jobService) {
        this.jobService = jobService;
    }


    @PostMapping("/listJob")
    public Result listJob(@RequestBody PageVo pageVo) {

        return jobService.listJob(pageVo);

    }

    @GetMapping("/listAllJob")
    public Result listAllJob() {

        List<Job> list = jobService.list();
        return Result.ok(list);

    }






    @PostMapping("/addJob")
    public Result addJob(@RequestBody @Validated JobReqVo jobReqVo) {

        return jobService.addJob(jobReqVo);

    }






}
